﻿using System;
using GeoAPI.Geometries;

namespace NetTopologySuite.Geometries
{
	public static class CoordinateSequenceEx
	{
		public static int GetHashCode(this ICoordinateSequence sequence, int baseValue, Func<int, int> operation)
		{
			if (sequence != null && sequence.Count > 0)
			{
				for (int i = 0; i < sequence.Count; i++)
				{
					baseValue = operation(baseValue) + sequence.GetX(i).GetHashCode();
				}
			}
			return baseValue;
		}
	}
}
